package java6681.mythrow;

//javac -d . Exception6681_4.java
//java java6681.mythrow.Exception6681_4
public class Exception6681_4 {
    public static void main(String[] args) {
        if (args.length >= 1) {
            try {
                isScore6681(args[0]);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            System.out.println("请输入命令行参数!");
        }
        System.out.println("**********Exception6681_4主方法结束！**********");
    }

    public static void isScore6681(String score) throws UpperException6681, LowerException6681 {
        try {
            int at = Integer.parseInt(score);
            if (at > 800) {
                throw new UpperException6681("成绩超过800！");
            } else if (at < 300) {
                throw new LowerException6681("成绩低于300！");
            }
        } catch (NumberFormatException e) {
            System.out.println(score + "成绩格式非法已预处理");
            e.printStackTrace();
            return;
        }finally {
            System.out.println("@@@关闭@@@");
        }
        System.out.println("当前成绩：" + score);
        System.out.println("==========isScore6681结束==========");
    }
}
